import request from './request'

export const getWorkOrderList = (params) => {
  return request({
    url: '/api/work-order/list',
    method: 'get',
    params
  })
}

export const createWorkOrder = (data) => {
  return request({
    url: '/api/work-order/create',
    method: 'post',
    data
  })
}

export const replyWorkOrder = (data) => {
  return request({
    url: '/api/work-order/reply',
    method: 'put',
    data
  })
}

export const cancelWorkOrder = (data) => {
  return request({
    url: '/api/work-order/cancel',
    method: 'put',
    data
  })
}

export const getWorkOrderDetail = (id) => {
  return request({
    url: `/api/work-order/${id}`,
    method: 'get'
  })
}

export const getWorkOrdersByRegion = (region) => {
  return request({
    url: '/api/work-order/region/query',
    method: 'post',
    data: { region }
  })
}